package logic

import (
	"context"
	"user_srv/internal/dao"

	"user_srv/internal/svc"
	"user_srv/user"

	"github.com/zeromicro/go-zero/core/logx"
)

type SendSmsLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLogic {
	return &SendSmsLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 验证码发送
func (l *SendSmsLogic) SendSms(in *user.SendSmsRequest) (*user.SendSmsResponse, error) {
	//调用业务逻辑
	_, err := dao.SendSms(in)
	if err != nil {
		return nil, err
	}
	return &user.SendSmsResponse{
		Message: "短信验证码发送成功",
	}, nil
}
